package com.wzh.dao;


import com.wzh.pojo.Po.Classinfo;
import com.wzh.pojo.Req.ClassinfoReq;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface Classdao  {
	@Update("update class set classname=#{classname},classstate=#{classstate},classteachername=#{classteachername},classplace=#{classplace} where classid=#{classid}")
	int updatbyid(Classinfo classinfo);

	@Delete("delete from class where classid=#{classid}")
	int deonebyid(Classinfo classinfo);

	@Insert("insert into class (classid,classname,classteachername,classplace) value (#{classid},#{classname},#{classteachername},#{classplace})")
	int addnew(Classinfo classinfo);

	List<Classinfo> getAll(ClassinfoReq classinfoReq);

	Integer getcounts(ClassinfoReq classinfoReq);

	//增加学生数量
	@Update("update class set classpeople=classpeople+#{changemount} where classid=#{classid}")
	int changeClassPeople(int changemount,int classid);
}
